package run.others;

import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.core.io.ClassPathResource;

import java.io.IOException;
import java.net.URL;
@Slf4j
public class ClasspathFindFile {
    @Test
    public void findFile() throws IOException {

        ClassPathResource classPathResource = new ClassPathResource("/templates/login.html");
        URL url = classPathResource.getURL();
        log.info("{},{}",url,classPathResource.exists());

        ClassPathResource classPathResource1 = new ClassPathResource("/static/index.html");
        URL url1 = classPathResource1.getURL();
        log.info("{},{}",url1,classPathResource1.exists());
    }
}